Image forming apparatuses of an electrophotographic type use a thermal fixing method that fixes a toner image by heating the toner image with a heater. In view of power saving, a hot line and a neutral line that supply power to the heater are provided with their respective relays. As relay contacts are welded due to aging, it is necessary to detect whether they are welded in view of protection of the heater. In PTL 1, relay welding detection is performed both when image formation is started and when image formation has ended.